
import { useParams,useNavigate } from "react-router-dom"

function Page2(){
    let useparams = useParams()
    console.log(useparams)
    let nav = useNavigate()

    return <>
        <button onClick={()=>{
            
            nav("/page1",{
                state:{
                    name:"轴承开"
                }
            })
        }}>跳转到Page1</button>
        <br/>
        <div>Page2</div>
    </>
}


export default Page2